Time tracking and time computation is essential within computer and communication systems.
Scheduling of resources is normally based on time computations. Time measurements are needed quite often. E.g. figuring out what the exact transfer time is when sending a data packet from one computer to another over a data network is needed for filling the transmission buffer in the sender in optimized fashion. If this time is measured with great accuracy, the transfer rate may even be increased. Another example is optimizing program code on a computer. The execution times of different codes must be known with high precision in order to find the optimized code.
The main attributes of a timer data structure for processing in a computer are resolution, reference time and the timer range. Resolution means the smallest positive time difference between two non-equal time values. The reference time means the point in time at which the time count is started. Range means the range between the smallest and the biggest possible time value. The range is usually limited by the size of the data structure (or register) the value is stored in. However, in modern computing systems, different time systems simultaneously deal with different kinds of timers, with different resolution, reference time and range.
On many Unix-based systems, the main time in user space counts elapsed seconds since 1st of Jan. 1970. The time range is 2^32-1 seconds. The MS-Windows' main application time is counted in milliseconds since 1 st Jan. 1900.
However, some other time systems with much higher resolutions, supported by hardware, are available on many systems. For instance, the TSC counter (Time Stamp Counter) that counts each CPU cycle from the computer power on, is available on PC platforms based on Intel 80×86 CPU's. CPU cycle time corresponds to the clock period of the clock signal a CPU is clocked. Although the TSC counter on Personal Computer platforms is implemented as a 64 bit register, it may be a disadvantage that the TSC counter could wrap around within some years, with the given high CPU frequencies of more than 3 GHz in modern computer systems. Of course, the TSC counter is reset each time after power on and system reset, so that it is not very likely that the maximum value will be reached. E.g. the TSC timer in a CPU clocked at a speed of 3 GHz can time events that span up to 194 years.
The other disadvantage of high-resolution counters, like the TSC counter, is the local validity of such counters. If two or more computing systems are independently operated, it is difficult to compare the time counted by TSC counters of the different systems. In network or communication systems it is however needed to monitor the data flow and processing stages with high time resolution.